<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
	<title>Title</title>
</head>
<body>

<div class="register_box ${registerShowed}">
	<div class="hide_register_btn"><i class="far fa-times-circle"></i></div>
	<form action="/register" class="register_form" method="post">
		<h1>Welcome</h1>
		<span>用户名：</span>
		<input class="textb" type="text" name="username" id="uName" placeholder="Username" required><br/>
		<span>密&nbsp;&nbsp;&nbsp;&nbsp;码：</span>
		<input class="textb" type="password" name="password" id="register_pwd" placeholder="password" required><br/>
		<span>确认密码：</span>
		<input class="textb" type="password" id="rePwd" placeholder="password" required><br/>
		<span>验证码：</span>
		<input class="code_input" id="re_verificationInput" type="text" name="verify">
		<input type="image" name="img-code" id="img-code"
			   alt="看不清？点击换图" src="/kaptcha" /><br/>
		<div class="alert alert-danger register_msg" role="alert" <c:if test="${empty errMsg}">hidden</c:if>>${errMsg}</div>
		<input type="submit" value="注册" class="register_btn" onclick="return verifyPwd()">
	</form>
</div>

<script>


	$(".show_register_btn").on("click",function(){
		$(".index_content").hide();
		$(".register_box").toggleClass("registerShowed");
	});
	$(".hide_register_btn").on("click",function(){
		$(".index_content").show();
		$(".register_box").toggleClass("registerShowed");
	});
	$("#img-code").on("click",function () {
		this.src = '/kaptcha?+rand='+Math.random();
		return false;
	})
</script>
</body>
</html>
